package com.senlingspace.system.service;

import com.senlingspace.common.core.domain.AjaxResult;
import com.senlingspace.system.domain.SlkjShoppingCart;
import com.senlingspace.system.domain.vo.MiniAppCartUpdateVo;
import com.senlingspace.system.domain.vo.MiniAppCartVo;
import com.senlingspace.system.domain.vo.MiniAppConfirmOrderRequest;

import java.util.List;

/**
 * 购物车服务
 *
 * @author lebronjames
 * @date 2024/10/03
 */
public interface ISlkjShoppingCartService {

    /**
     * 添加购物车
     *
     * @param request
     * @param customerId
     * @param shopId
     */
    AjaxResult addCart(MiniAppCartVo request, Long customerId, Long shopId);

    /**
     * 通过客户ID查询购物车列表
     *
     * @param customerId
     * @return {@link List }<{@link SlkjShoppingCart }>
     */
    List<SlkjShoppingCart> findByCustomerId(Long customerId);

    /**
     * 更新购物车
     *
     * @param request
     * @param customerId
     * @param shopId
     * @return {@link AjaxResult }
     */
    AjaxResult updateCart(MiniAppCartUpdateVo request, Long customerId, Long shopId);

    /**
     * 确认订单（目前只支持商品）
     *
     * @param request
     * @param customerId
     * @param shopId
     * @param customerPhone
     * @return {@link AjaxResult }
     */
    AjaxResult confirmOrder(MiniAppConfirmOrderRequest request, Long customerId, Long shopId, String customerPhone);

}
